package com.up.api.produce;



import com.up.kafka.annotation.KafkaStringSender;
import com.up.kafka.sender.MessageSender;
import com.up.kafka.topic.KafkaTopicKey;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @author: liuchengjun
 * @title: ProduceTest
 * @projectName: 海联技术中台V2.0
 * @depart 软件事业部
 * @description:
 * @date: 2023/9/4/004 16:36 (星期一)
 * @since V2.0
 */
@Component
public class ProduceTest {
    @KafkaStringSender
    private MessageSender messageSender;

    public Boolean sendText() {
        try {
            messageSender.sendOnce("upupupupuppupupupup","up-test", KafkaTopicKey.TEST_STRING);
            return true;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
